<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link href="AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css" />
		<link href="AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css" />

		<link href="basic/css/demo.css" rel="stylesheet" type="text/css" />

		<link href="css/hmstyle.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="js/vue2.5.js" ></script>
		<script type="text/javascript" src="js/axios.min.js" ></script>
		<script type="text/javascript" src="js/jquery-1.11.2.min.js" ></script>
		<script type="text/javascript" src="js/global.js" ></script>
		<script type="text/javascript" src="js/bootstrap/js/bootstrap.js" ></script>
		<script type="text/javascript" src="js/layer/layer.js" ></script>
		<script src="js/param.js"></script>
		
		<script src="AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
		<script src="AmazeUI-2.4.2/assets/js/amazeui.min.js"></script>
		<style>
			.aa:hover{
				color:#337AB7;
			}
			.bb{
				position: relative;
				display:inline-block;
				width:19px;
				height:19px;
				border-radius: 50%;
				color: white;			
				background: red;
				top:8px;
				text-align: center;
				margin:0;
				padding:0;
			}
			#ss{
				position: relative;
				top:-6px;
				font-size:16px;
			}
		</style>
	</head>
	<body>
		<!--头 -->
		<header class="container">
			<article>
				<div class="mt-logo">
					<!--顶部导航条 -->
					<div class="am-container header">
						<ul class="message-l">
							<div class="topMessage">
								<div class="menu-hd">
									<span>欢迎</span>
									<span id="LoginName"></span>&nbsp;&nbsp;&nbsp; |
									<a href="logout" target="_blank" class="aa">登出&nbsp;/logout</a>
								</div>
							</div>
						</ul>
						<ul class="message-r">
							<div class="topMessage home">
								<div class="menu-hd"><a href="index.html" target="content" class="h aa">商城首页</a></div>
							</div>
							<div class="topMessage my-shangcheng">
								<div class="menu-hd MyShangcheng "><a href="person/information.html" class="aa" target="content"><i class=" am-icon-user am-icon-fw"></i>个人中心</a></div>
							</div>
							<div class="topMessage mini-cart">
								<div class="menu-hd"><a id="mc-menu-hd" href="home/shopcart.html" class="aa" target="content"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum" class="h bb" > <span id="ss">{{cartcount}}</span></strong></a></div>
							</div>
							<div class="topMessage favorite">
								<div class="menu-hd"><a href="person/collection.html" target="content" class="aa"><i class="am-icon-heart am-icon-fw"></i><span>收藏夹</span></a></div>
						</ul>
						</div>

						<!--悬浮搜索框-->

						<div class="nav white">
							<div class="logoBig">
								<li><img src="images/logobig.png" /></li>
							</div>

							<div class="search-bar pr">
								<a name="index_none_header_sysc" href="#"></a>
								<form>
									<input id="searchInput" name="index_none_header_sysc" type="text" placeholder="搜索" autocomplete="off">
									<a id="ai-topsearch" class="submit am-btn" href="javascript:;" target="content"> 搜索</a>
								</form>
							</div>
						</div>

						<div class="clear"></div>
					</div>
		
			</article>
		</header>
		<script>
		var uid = localStorage.getItem('id');
		var vue = new Vue({
			el:'.container',
			data:{
				cartcount:''
			},
	        created: function () {
	            setInterval(this.get, 1000);
	        },
			methods:{
				get: function() {
					
					axios.get(baseUrl + '/cart/getnum', {
							params: {
								uid:uid
							}

						}).then(function(response) {
							this.cartcount=response.data;

						}.bind(this))
						.catch(function(error) {
							
						});
				},
			
			},mounted: function() {
				this.get();
			}
		});
			
		</script>
		
		<script>
		$(function(){
			if(localStorage.getItem('LoginName')){
				$('#LoginName').text(localStorage.getItem('LoginName'));
			}
			
			$('#ai-topsearch').on('click',function(){
				var a ="home/search.html";
				$('#ai-topsearch').attr("href",a);
				localStorage.setItem("gname",$('#searchInput').val());	
			})
			
			
		});
		
		</script>
	</body>
</html>
